package reflect;


import reflect.annotations.AutoRunClass;
import reflect.annotations.AutoRunMethod;

@AutoRunClass
public class Person {



    private String name;
    private int age;

    public Person()
    {
    }

    public Person(String name) {
        this.name = name;
    }

    public Person(String name, int age)
    {
        this.name = name;
        this.age = age;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public int getAge()
    {
        return age;
    }

    public void setAge(int age){
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
//getMethod()需要public 的

    @AutoRunMethod(value = 3)
    public void sayHi()
    {
        System.out.println(name+":hello!");
    }

//    @AutoRunMethod
//    private void sayHiTest()
//    {
//        System.out.println(name+":hello!Test");
//    }


    public void sayHi( String info)
    {
        System.out.println(name+":hello!"+info);
    }


    public void sayHi(String info,int count)
    {
        for (int i = 0; i < count; i++) {
            System.out.println(name+":"+info);
        }
    }

    private void heHe(){
        System.out.println("我是Person类的私有方法呵呵");
    }

    @AutoRunMethod()
    public void doSome()
    {
        System.out.println("做某事");
    }

    @AutoRunMethod(3)
    public void sleep()
    {
        System.out.println("睡觉");
    }

    public void watchTv()
    {
        System.out.println("看电视");
    }

    public void study()
    {
        System.out.println("学习");
    }

    public void playGame()
    {
        System.out.println("打游戏");
    }

    public void sing()
    {
        System.out.println("在唱歌");
    }

    public void say(String info)
    {
        System.out.println("在跳舞"+info);
    }

    public void say(String info,int count)
    {
        for (int i = 0; i < count; i++) {
            System.out.println("在跳舞"+info);
        }
    }


}
